package com.jike.shop.cloud.enums;


/**
 * @author Briller
 */

public enum PromotionTargetTypeEnum {
    ITEM(1, "商品"),
    STORE(2, "门店"),
    SKU(3, "sku"),
    BRAND(4, "品牌"),
    ;

    private Integer code;
    private String description;

    PromotionTargetTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }


    public String getDescription() {
        return description;
    }

    public static PromotionTargetTypeEnum getInstance(Integer code) {
        for (PromotionTargetTypeEnum typeEnum : values()) {
            if(typeEnum.code.equals(code)) {
                return typeEnum;
            }
        }
        return null;
    }

}
